﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace PosClient.Model
{
    public class VipBase: INotifyPropertyChanged
    {
        private string _VipCode;
        private string _VipName;
        private string _Mobile;
        private VipLevel _VipLevel;
        private int _GrowthCurrent;
        private decimal _DepositCurrent;
        private decimal _PointCurrent;
        private List<Ticket> _Tickets;
        private int _TicketCount;
        private List<string> _Lables;

        /// <summary>
        /// 卡号
        /// </summary>
        public string VipCode
        {
            get => _VipCode;
            set
            {
                if (value != _VipCode)
                {
                    _VipCode = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 会员名称
        /// </summary>
        public string VipName
        {
            get => _VipName;
            set
            {
                if (value != _VipName)
                {
                    _VipName = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile
        {
            get => _Mobile;
            set
            {
                if (value != _Mobile)
                {
                    _Mobile = value;
                    NotifyPropertyChanged();
                }
            }
        }

        public VipLevel VipLevel
        {
            get => _VipLevel;
            set
            {
                if (value != _VipLevel)
                {
                    _VipLevel = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 成长值
        /// </summary>
        public int GrowthCurrent
        {
            get => _GrowthCurrent;
            set
            {
                if (value != _GrowthCurrent)
                {
                    _GrowthCurrent = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 余额
        /// </summary>
        public decimal DepositCurrent
        {
            get => _DepositCurrent;
            set
            {
                if (value != _DepositCurrent)
                {
                    _DepositCurrent = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 积分
        /// </summary>
        public decimal PointCurrent
        {
            get => _PointCurrent;
            set
            {
                if (value != _PointCurrent)
                {
                    _PointCurrent = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 券列表
        /// </summary>
        public List<Ticket> Tickets
        {
            get => _Tickets;
            set
            {
                if (value != _Tickets)
                {
                    _Tickets = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 券数
        /// </summary>
        public int TicketCount
        {
            get => _TicketCount;
            set
            {
                if (value != _TicketCount)
                {
                    _TicketCount = value;
                    NotifyPropertyChanged();
                }
            }
        }

        /// <summary>
        /// 标签
        /// </summary>
        public List<string> Lables
        {
            get => _Lables;
            set
            {
                if (value != _Lables)
                {
                    _Lables = value;
                    NotifyPropertyChanged();
                }
            }
        }



        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); //实现通知刷新
        }

    }
    public class Ticket
    { 
        public string TicketNo { get; set; }

        public string TicketName { get; set; }

        public string TicketType { get; set; }
    }

    public class VipLevel
    { 
        public string LevelCode { get; set; }

        public string LevelName { get; set; }

        //会员类型
        public int LevelType { get; set; }

        public decimal DisCount { get; set; }
        //会员等级类型
        public int LevelGradeType { get; set; }
        //会员等级成长值
        public int LevelGrade { get; set; }

        public int Deleted { get; set; }
    }
}
